$(function() {
				Date.prototype.isLeapYear = function() {
					return(0 == this.getYear() % 4 && ((this.getYear() % 100 != 0) || (this.getYear() % 400 == 0)));
				}
				var myDate = new Date();
				var date = myDate.getDate();
				var week = myDate.getDay();
				var month = myDate.getMonth() + 1;
				var year=myDate.getFullYear();
				var maxday;
				if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
					maxday = 31;
				} else if(month == 4 || month == 6 || month == 9 || month == 11) {
					maxday = 30;
				} else if(month == 2) {
					if(myDate.isLeapYear()) {
						maxday = 29;
					} else {
						maxday = 28;
					}
				}
				var html = "";
				for(var i = 0; i < 28; i++) {
					var content;
					switch(week) {
						case 0:
							content = "周日"
							break;
						case 1:
							content = "周一"
							break;
						case 2:
							content = "周二"
							break;
						case 3:
							content = "周三"
							break;
						case 4:
							content = "周四"
							break;
						case 5:
							content = "周五"
							break;
						case 6:
							content = "周六"
							break;
					}
					html += '<li data-day='+year+'-'+month+'-'+date+' data-month='+month+' data-year='+year+' >'
					html += '<span>' + date + '</span><br />'
					html += '<a href="javascript:void(0)">' + content + '</a>'
					html += '</li>'
					date++;
					if(date > maxday) {
						date = 1;
						month++
						if(month>12){
							month=1;
							year++
						}
					}
					week++;
					if(week > 6) {
						week = 0
					}
				}
				$(".clearfix").html(html)
				$('#demo06').navbarscroll({
					defaultSelect: 0,
					scrollerWidth: 6,
					fingerClick: 1,
					endClickScroll: function(obj) {}
				});

			});
			function program(date) {
				if(mdata == "") return
				var num1 = 0,
					num2 = 0;
				var myDate = new Date();
				var day=myDate.getDate();
				if(day==date){
					var hour=myDate.getHours()
					var minute=myDate.getMinutes()
					if(hour>9){
						$("#morning").html('<h4 class="weui-media-box__title">不可用</h4>')
						$("#morning").addClass("otherusing")
					}else if(hour==9&&minute>30){
						$("#morning").html('<h4 class="weui-media-box__title">不可用</h4>')
						$("#morning").addClass("otherusing")
					}
					if(hour>14||(hour==9&&minute>30)){
						$("#afternoon").html('<h4 class="weui-media-box__title">不可用</h4>')
						$("#afternoon").addClass("otherusing")
					}else if(hour==14&&minute>30){
						$("#afternoon").html('<h4 class="weui-media-box__title">不可用</h4>')
						$("#afternoon").addClass("otherusing")
					}
				}
				if(date<10){
					date="0"+date
				}
				$.ajaxSettings.async = false;
				$.post("${base}/userIdToName",{userid:userid},function(data){
					var username=data
				}
					
				})
				for(var i = 0; i < mdata.length; i++) {
					var num = getnum(mdata[i].starttime)
					if(num == date) {
						var html = "";
						if(mdata[i].isprivate=="false"){
							html += '<div class="weui-panel" data-id='+ mdata[i].xh+'>'
							html += '<div class="weui-panel__bd">'
							html += '<div class="weui-media-box weui-media-box_text">'
							html += '<h4 class="weui-media-box__title">' + mdata[i].topic + '</h4>'
							html += '<p class="weui-media-box__desc">' + mdata[i].meetbz + '</p>'
							html += '</div>'
							html += '</div>'
							html += '</div>'
						}else if(mdata[i].ydr.indexOf(username)==-1&&mdata[i].chr.indexOf(username)==-1&&mdata[i].ydr.indexOf(username)==-1){
							html += '<h4 class="weui-media-box__title">私密会议</h4>'
							
						}
						
						
						var hour1 = gethour(mdata[i].starttime);
						var hour2 = gethour(mdata[i].finishtime);
						if(hour1 < 12) {
							$("#morning").html(html)
							num1++
							$("#morning").addClass("otherusing")
			
						} else {
							$("#afternoon").html(html)
							$("#afternoon").addClass("otherusing")
							num2++
						}
						if(hour1 < 12&&hour2 > 12) {
							$("#afternoon").html(html)
							$("#afternoon").addClass("otherusing")
							num2++
						}
					}
				}
				if(num1 == 1) {
					$("#morning .weui-panel").css("width", "99%")
				} else {
					$("#morning .weui-panel").css("width", "49%")
				}
				if(num2 == 1) {
					$("#afternoon .weui-panel").css("width", "99%")
				} else {
					$("#afternoon .weui-panel").css("width", "49%")
				}
			}
			$("#morning,#afternoon").on("click",".weui-panel",function(){
				var xh=$(this).attr("data-id");
				var href = "../meet/meetinfo?xh=" + xh;
				location.href=href
			})